<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>Sales Lead</title>
    </h:head>
    <f:view beforePhase="#{UserDisplayManagedBean.doDisplay}">
        <f:view beforePhase="#{SalesLeadManagedBean.initView}">
            <h:body>
                <h:form prependId="false">
                    <!-- IDLE DIALOG for -->
                    <p:confirmDialog message="You have been idle for 5 minutes. Do you want to continue?"  
                                     showEffect="bounce" hideEffect="explode"  
                                     header="Warning message" severity="alert" widgetVar="confirmation">  
                        <p:commandButton value="Yes" onclick="confirmation.hide()" type="button" /> 
                        <p:commandButton value="No" update="panel" oncomplete="confirmation.hide()"  
                                         actionListener="#{UserManagedBean.doLogout}" /> 
                    </p:confirmDialog>

                    <p:idleMonitor timeout="300000" onidle="confirmation.show()" />  
                    <!--END OF IDLE DIALOG-->

                    <p:growl id="growl" showDetail="true" />  
                    <p:growl id="notif" showDetail="true"/>
                    <div id="top" class="top">
                        <h:graphicImage value="/image/newHeader.jpg"/>
                    </div>
                    <div id="content">
                        <p:poll interval="5"   
                                actionListener="#{MessageManagedBean.checkNewMessage}" immediate="true" update="notif" />
                        <table >
                            <tr>
                                <td>
                                    <p:toolbar style="font-size:12px;margin-top:0%;height:30px;width:200px"> 
                                        <p:toolbarGroup align="right">
                                            <p:button title="Home" image="ui-icon-home" outcome="SalesDeptWorkspace"/>                                   
                                            <p:button title="Notes" image="ui-icon-note" outcome="tasks"/>                                    
                                            <p:button title="Mail" outcome="messages" image="ui-icon-mail-closed"/>                                     
                                            <p:button title="Edit Preferences" image="ui-icon-gear"/>                                    
                                            <p:button title="Help" image="ui-icon-help"/>
                                            <p:commandButton title="Log Out" immediate="true" type="submit" image="ui-icon-close" actionListener="#{UserManagedBean.doLogout}"/> 
                                        </p:toolbarGroup>
                                    </p:toolbar>
                                </td>
                                <td> <h:graphicImage value="people-icon.png" style="width:40px;height:40px" />
                                    <h:outputText value="         "/>
                                    <h:outputText value="Leads" style="font-family:Tahoma;font-size:20px;font-weight:bolder"/>
                                    <p:spacer width="100" height="10"/></td>
                            </tr>
                            <tr>

                                <td style="vertical-align:top">
                                    <p:menu style="width:200px;font-size: 12px;font-family: Tahoma;border-style: ridge">  
                                        <p:submenu label="Sales Force Automation" >  
                                            <p:menuitem value="Customers" url="http://localhost:8080/MerlionERP-war/CRM/customers.xhtml" ajax="false" icon="ui-icon ui-icon-person"/>  
                                            <p:menuitem value="Contacts" url="http://localhost:8080/MerlionERP-war/CRM/contacts.xhtml" ajax="false" icon="ui-icon ui-icon-person" />
                                            <p:menuitem value="Leads" url="http://localhost:8080/MerlionERP-war/CRM/salesLeads.xhtml" ajax="false" icon="ui-icon ui-icon-person" />
                                        </p:submenu>
                                        <p:submenu label="Sales Order Processing">
                                            <p:menuitem value="Pricebooks" url="http://localhost:8080/MerlionERP-war/CRM/pricebooks.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Inquiries" url="http://localhost:8080/MerlionERP-war/CRM/salesInquiries.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Quotations" url="http://localhost:8080/MerlionERP-war/CRM/quotations.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Purchase Orders" url="http://localhost:8080/MerlionERP-war/CRM/purchaseOrders.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Sales Orders" url="http://localhost:8080/MerlionERP-war/CRM/salesOrders.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Delivery Orders" url="http://localhost:8080/MerlionERP-war/CRM/deliveryOrdersCRM.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                        </p:submenu>  
                                    </p:menu>
                                    <p:menu type="tiered" style="width:200px;font-family:Tahoma;font-size:12px">
                                        <p:submenu label="Create New" icon="ui-icon ui-icon-extlink">  
                                            <p:menuitem value="Customer" url="http://localhost:8080/MerlionERP-war/CRM/createNewCustomer.xhtml" />
                                            <p:menuitem value="Sales Lead" url="http://localhost:8080/MerlionERP-war/CRM/createNewSalesLead.xhtml" /> 
                                            <p:menuitem value="Contact" url="http://localhost:8080/MerlionERP-war/CRM/createNewContact.xhtml" />
                                            <p:menuitem value="Inquiry" url="http://localhost:8080/MerlionERP-war/CRM/addSalesInquiry.xhtml"/>
                                            <p:menuitem value="Quotation" url="http://localhost:8080/MerlionERP-war/CRM/addQuotation.xhtml"/>
                                            <p:menuitem value="Purchase Order" url="http://localhost:8080/MerlionERP-war/CRM/addPurchaseOrder.xhtml"/>
                                            <p:menuitem value="Sales Order" url="http://localhost:8080/MerlionERP-war/CRM/addSalesOrder.xhtml"/>
                                            <p:menuitem value="Delivery Order" url="http://localhost:8080/MerlionERP-war/CRM/addDeliveryOrder.xhtml"/>      
                                        </p:submenu>
                                    </p:menu>
                                    <p:calendar mode="inline" style="font-size:11px;font-family:Tahoma"/>
                                </td>

                                <td style="vertical-align:top">

                                    <p:toolbar style="background-color:  #d9bb73;font-size: 70%;width:99.5%"> 
                                        <p:toolbarGroup align="left">  
                                            <p:button value="New Sales Lead" outcome="createNewSalesLead" image="ui-icon-plus"/>
                                            <p:button value="View Converted Leads" outcome="convertedLeads" image="ui-icon-person"/>
                                            <p:commandButton value="Delete" title="Delete" image="ui-icon ui-icon-trash" oncomplete="deleteDialog.show()"/>                                   
                                            <p:commandButton value="Convert To Customer" oncomplete="convertToCustomer.show()" 
                                                             update="panel" image="ui-icon ui-icon-transfer-e-w"/>
                                            <p:commandButton value="Sales Lead Report" ajax="false" immediate="true" actionListener="#{jasperManagedBean.generateSalesLeadReport}" />
                                        </p:toolbarGroup>  
                                    </p:toolbar> 

                                    <p:dataTable id="panel" 
                                                 var="salesLeads" value="#{SalesLeadManagedBean.sales}"                       
                                                 paginator="true" rows="5"  
                                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                                 rowEditListener="#{SalesLeadManagedBean.onEditRow}"
                                                 rowsPerPageTemplate="5,10,15"  style="font-size:60%;width:100%"
                                                 selection="#{SalesLeadManagedBean.selectedSalesLeads}"
                                                 emptyMessage="No data found with given criteria" widgetVar="salesLeadTable">  

                                        <f:facet name="header">                           
                                            <p:outputPanel style="text-align:right"  >
                                                <h:outputText value="Search all fields:" style="margin-left:840px" />  
                                                <p:inputText id="globalFilter" onkeyup="salesLeadTable.filter()" style="right:-100px;width:150px" />  
                                            </p:outputPanel>
                                        </f:facet> 

                                        <p:column selectionMode="multiple" /> <!--style="border-left-color:transparent;border-right-color:transparent"/>-->

                                        <p:column headerText="View" style="width:16px;border-right-color:transparent" >  
                                            <p:rowToggler />  
                                        </p:column> 

                                        <p:column headerText="Edit" style="width:20px;border-left-color:transparent;border-right-color:transparent">    
                                            <p:rowEditor/>
                                        </p:column>


                                        <p:column headerText="Del." style="width: 16px;border-left-color:transparent"> <!--"border-right-color:transparent">-->  
                                            <!--DELETE-->
                                            <p:commandButton title="Delete" image="ui-icon ui-icon-trash" ajax="true" immediate="true"
                                                             update="panel" oncomplete="customerdialog.show()">
                                                <f:setPropertyActionListener target="#{SalesLeadManagedBean.selectedSalesLead}"
                                                                             value="#{salesLeads}"/>
                                            </p:commandButton>
                                        </p:column>


                                        <!--SALES LEAD ID-->
                                        <p:column sortBy="#{salesLeads.id}" filterBy="#{salesLeads.id}" filterMatchMode="contains"
                                                  filterStyle="width:50px" >
                                            <!--style="border-left-color:transparent;border-right-color:transparent">-->
                                            <f:facet name="header">
                                                <h:outputText value="ID"/>
                                            </f:facet>
                                            <h:outputText value="#{salesLeads.id}"/>
                                        </p:column>

                                        <!--SALES LEAD NAME-->
                                        <p:column headerText="Company Name" sortBy="#{salesLeads.name}" filterBy="#{salesLeads.name}" 
                                                  filterMatchMode="contains">
                                            <!--style="border-left-color:transparent;border-right-color:transparent">  -->
                                            <p:cellEditor>
                                                <f:facet name="output">  
                                                    <h:outputText value="#{salesLeads.name}" />  
                                                </f:facet>  
                                                <f:facet name="input">
                                                    <p:inputText value="#{salesLeads.name}" style="width:100%"/>
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>   

                                        <!--CONTACT NUMBER-->
                                        <p:column headerText="Contact Number" sortBy="#{salesLeads.contactNum}" 
                                                  filterBy="#{salesLeads.contactNum}" filterMatchMode="contains">
                                            <!--style="border-left-color:transparent;border-right-color:transparent">-->  
                                            <p:cellEditor>
                                                <f:facet name="output">  
                                                    <h:outputText value="#{salesLeads.contactNum}" />  
                                                </f:facet>
                                                <f:facet name="input">
                                                    <p:inputText value="#{salesLeads.contactNum}" style="width:100%" />
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>  


                                        <!--BUSINESS TYPE-->
                                        <p:column headerText="Type" sortBy="#{salesLeads.businessType}" 
                                                  filterStyle="width:55px" filterBy="#{salesLeads.businessType}" filterMatchMode="contains"
                                                  style="width:50px">
                                            <!--";border-left-color:transparent;border-right-color:transparent"> --> 
                                            <p:cellEditor>
                                                <f:facet name="output">  
                                                    <h:outputText value="#{salesLeads.businessType}" />  
                                                </f:facet>
                                                <f:facet name="input"> 
                                                    <h:selectOneMenu value="#{salesLeads.businessType}">
                                                        <f:selectItem itemValue="Direct" itemLabel="Direct"/>
                                                        <f:selectItem itemLabel="Wholesale" itemValue="Wholesale"/>
                                                    </h:selectOneMenu>
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>  

                                        <!--EMAIL ADDRESS-->
                                        <p:column headerText="Email Address" sortBy="#{salesLeads.emailAddress}" 
                                                  filterBy="#{salesLeads.emailAddress}" filterMatchMode="contains">
                                            <!-- style="border-left-color:transparent;border-right-color:transparent"> --> 
                                            <p:cellEditor>
                                                <f:facet name="output">  
                                                    <h:outputText value="#{salesLeads.emailAddress}" />  
                                                </f:facet>
                                                <f:facet name="input"> 
                                                    <p:inputText value="#{salesLeads.emailAddress}" style="width:100%" />
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>


                                        <!--STATUS-->
                                        <p:column headerText="Status" sortBy="#{salesLeads.status}" 
                                                  filterStyle="40px" filterBy="#{salesLeads.status}" filterMatchMode="contains"
                                                  style="width:50px">
                                            <!--border-left-color:transparent;border-right-color:transparent">-->
                                            <p:cellEditor>
                                                <f:facet name="output">
                                                    <h:outputText value="#{salesLeads.status}"/>
                                                </f:facet>
                                                <f:facet name="input">            
                                                    <h:selectOneMenu value="#{salesLeads.status}">
                                                        <f:selectItem itemLabel="Open" itemValue="Open"/>
                                                        <f:selectItem itemLabel="Contacted" itemValue="Contacted"/>
                                                        <f:selectItem itemLabel="Qualified" itemValue="Qualified"/>
                                                        <f:selectItem itemLabel="Unqualified" itemValue="Unqualified"/>                                            
                                                    </h:selectOneMenu>
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>

                                        <!--DATE CREATED-->
                                        <p:column sortBy="#{salesLeads.dateCreated}" 
                                                  filterBy="#{salesLeads.dateCreated}" 
                                                  filterMatchMode="contains" >
                                            <!--style="border-left-color:transparent;border-right-color:transparent">-->
                                            <f:facet name="header">
                                                <h:outputText value="Date Created"/>
                                            </f:facet>
                                            <h:outputText value="#{salesLeads.dateCreated}"/>
                                        </p:column>


                                        <p:column style="width:32px;border-right-color:transparent" >
                                            <!--border-left-color:transparent;border-right-color:transparent"> --> 
                                            <p:commandLink update="display1" oncomplete="editDialog.show()" title="Edit Details">  
                                                <p:graphicImage value="about_icon.png" style="width:20px;height:20px"/>
                                                <f:setPropertyActionListener value="#{salesLeads}" target="#{SalesLeadManagedBean.selectedViewSalesLead}" />  
                                                <f:setPropertyActionListener value="#{true}" target="#{SalesLeadManagedBean.editMode}" />  
                                            </p:commandLink>                                                                
                                        </p:column>

                                        <p:column>
                                            <p:commandButton update="display2" oncomplete="convertToCustomer.show()"
                                                             value="Convert To Customer">
                                                <f:setPropertyActionListener target="#{SalesLeadManagedBean.selectedViewSalesLead}"
                                                                             value="#{salesLeads}"/>

                                                <f:setPropertyActionListener value="#{true}" target="#{SalesLeadManagedBean.editMode2}" />  
                                            </p:commandButton>
                                        </p:column>

                                        <p:rowExpansion>  
                                            <h:panelGrid id="display" columns="6" cellpadding="3"
                                                         style="font-family:Tahoma; font-size:10px;border-color:transparent;column-rule-style:hidden">

                                                <h:outputText value="Sales Lead Id" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.id}" />

                                                <h:outputText value="Date Created" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.dateCreated}" />  

                                                <h:outputText value="Salutation" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.salutation}" />  

                                                <h:outputText value="Company Name" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.name}" />

                                                <h:outputText value="Company Reg. ID" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.companyRegId}" />

                                                <h:outputText value="First Name" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.firstName}" />

                                                <h:outputText value="Business Type" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.businessType}" />

                                                <h:outputText value="Last Name" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.lastName}" />

                                                <h:outputText value="Industry" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.industry}" />

                                                <h:outputText value="Phone Number" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.contactNum}" />

                                                <h:outputText value="Annual Revenue" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.annualRevenue}" />

                                                <h:outputText value="Mobile Number" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.mobileNum}" />

                                                <h:outputText value="Number of Employees" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.numOfEmployees}" />

                                                <h:outputText value="Fax Number" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.faxNum}" />  

                                                <h:outputText value="Website" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.website}" />

                                                <h:outputText value="Title" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.title}" />  

                                                <h:outputText value="Department" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.department}" />

                                                <h:outputText value="Email Address" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.emailAddress}" />

                                                <h:outputText value="Rating" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.rating}" />

                                                <h:outputText value="Lead Source" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.leadSource}" /> 

                                                <h:outputText value="Status" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.status}" /> 

                                                <h:outputText value="Address" /> 
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.address}" />  

                                                <h:outputText value="Country" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.country}" />  

                                                <h:outputText value="City" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.city}" />  

                                                <h:outputText value="Postal Code" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.postalCode}" /> 

                                                <h:outputText value="Description" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{salesLeads.description}" /> 

                                            </h:panelGrid>  
                                        </p:rowExpansion>

                                    </p:dataTable>  


                                    <!--DIALOG FOR DELETING A  SINGLE ROW-->
                                    <p:confirmDialog message="Are you sure you want to delete this sales lead?"  
                                                     showEffect="blind" hideEffect="explode"  
                                                     header="Delete Sales Lead" severity="alert" widgetVar="customerdialog">  
                                        <center>
                                            <p:commandButton value="Yes" update="panel" ajax="true" immediate="true" oncomplete="customerdialog.hide()"  
                                                             actionListener="#{SalesLeadManagedBean.delete}" />  
                                            <p:commandButton value="No" onclick="customerdialog.hide()" type="button" />   
                                        </center>

                                    </p:confirmDialog>  


                                    <p:ajaxStatus style="width:16px;height:16px;">  
                                        <f:facet name="start">  
                                            <h:graphicImage value="25(2).gif" />  
                                        </f:facet>  

                                        <f:facet name="complete">  
                                            <h:outputText value="" />  
                                        </f:facet>  
                                    </p:ajaxStatus>
                                </td>
                            </tr>

                            <tr></tr>
                        </table>

                        <p:dialog header="Sales Lead Detail" widgetVar="editDialog" resizable="false"  
                                  width="800" showEffect="blind" hideEffect="blind">  
                            <center>
                                <h:panelGrid id="display1" columns="6" cellpadding="4" style="font-family:Tahoma; font-size:12px">  


                                    <h:outputText value="Sales Lead Id" />  
                                    <h:outputText value=":"/>
                                    <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.id}" />  

                                    <h:outputText value="Date Created" />  
                                    <h:outputText value=":"/>
                                    <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.dateCreated}" />  


                                    <h:outputText value="Company Name" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.name}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.name}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Company Name"/>  
                                    </h:panelGroup>  

                                    <h:outputText value="Company Reg. ID" />  
                                    <h:outputText value=":"/>
                                    <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.companyRegId}" />  


                                    <h:outputText value="Salutation" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.salutation}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <h:selectOneMenu  value="#{SalesLeadManagedBean.selectedViewSalesLead.salutation}"  rendered="#{SalesLeadManagedBean.editMode}">
                                            <f:selectItem itemLabel="-None-" itemValue="-"/>
                                            <f:selectItem itemLabel="Mr." itemValue="Mr."/>
                                            <f:selectItem itemLabel="Mrs." itemValue="Mrs."/>
                                            <f:selectItem itemLabel="Ms." itemValue="Ms."/>
                                            <f:selectItem itemLabel="Dr." itemValue="Dr."/>
                                            <f:selectItem itemLabel="Prof." itemValue="Prof."/>
                                        </h:selectOneMenu>
                                    </h:panelGroup>  

                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>

                                    <h:outputText value="First Name" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.firstName}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.firstName}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="First Name"/>  
                                    </h:panelGroup> 

                                    <h:outputText value="Business Type" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.businessType}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <h:selectOneMenu value="#{SalesLeadManagedBean.selectedViewSalesLead.businessType}" rendered="#{SalesLeadManagedBean.editMode}">  
                                            <f:selectItem itemLabel="Direct" itemValue="Direct" />  
                                            <f:selectItem itemLabel="Wholesale" itemValue="Wholesale"/>
                                        </h:selectOneMenu>  
                                    </h:panelGroup>  


                                    <h:outputText value="Last Name" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.lastName}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.lastName}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Last Name"/>  
                                    </h:panelGroup> 

                                    <h:outputText value="Industry "/>
                                    <h:outputText value=": "/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.industry}"  style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>
                                        <h:selectOneMenu  value="#{SalesLeadManagedBean.selectedViewSalesLead.industry}" rendered="#{SalesLeadManagedBean.editMode}">
                                            <f:selectItem itemLabel="-None-" itemValue=""/>
                                            <f:selectItem itemLabel="Agriculture" itemValue="Agriculture"/>
                                            <f:selectItem itemLabel="Apparel" itemValue="Apparel"/>
                                            <f:selectItem itemLabel="Banking" itemValue="Banking"/>
                                            <f:selectItem itemLabel="Biotechnology" itemValue="Biotechnology"/>
                                            <f:selectItem itemLabel="Chemicals" itemValue="Chemicals"/>
                                            <f:selectItem itemLabel="Communications" itemValue="Communications"/>
                                            <f:selectItem itemLabel="Construction" itemValue="Construction"/>
                                            <f:selectItem itemLabel="Consulting" itemValue="Consulting"/>
                                            <f:selectItem itemLabel="Education" itemValue="Education"/>                              
                                            <f:selectItem itemLabel="Electronics" itemValue="Electronics"/>
                                            <f:selectItem itemLabel="Energy" itemValue="Energy"/>
                                            <f:selectItem itemLabel="Engineering" itemValue="Engineering"/>
                                            <f:selectItem itemLabel="Entertainment" itemValue="Entertainment"/>
                                            <f:selectItem itemLabel="Environmental" itemValue="Environmental"/>
                                            <f:selectItem itemLabel="Finance" itemValue="Finance"/>
                                            <f:selectItem itemLabel="Food and Beverage" itemValue="Food and Beverage"/>
                                            <f:selectItem itemLabel="Government" itemValue="Government"/>
                                            <f:selectItem itemLabel="Healthcare" itemValue="Healthcare"/>
                                            <f:selectItem itemLabel="Hospitality" itemValue="Hospitality"/>
                                            <f:selectItem itemLabel="Insurance" itemValue="Insurance"/>
                                            <f:selectItem itemLabel="Machinery" itemValue="Machinery"/>
                                            <f:selectItem itemLabel="Manufacturing" itemValue="Manufacturing"/>
                                            <f:selectItem itemLabel="Media" itemValue="Media"/>
                                            <f:selectItem itemLabel="Not For Profit" itemValue="Not For Profit"/>
                                            <f:selectItem itemLabel="Recreation" itemValue="Recreation"/>
                                            <f:selectItem itemLabel="Retail" itemValue="Retail"/>
                                            <f:selectItem itemLabel="Shipping" itemValue="Shipping"/>
                                            <f:selectItem itemLabel="Technology" itemValue="Technology"/>
                                            <f:selectItem itemLabel="Telecommunications" itemValue="Telecommunications"/>
                                            <f:selectItem itemLabel="Transportation" itemValue="Transportation"/>
                                            <f:selectItem itemLabel="Utilities" itemValue="Utilities"/>
                                            <f:selectItem itemLabel="Other" itemValue="Other"/>
                                        </h:selectOneMenu>
                                    </h:panelGroup>

                                    <h:outputText value="Phone Number" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.contactNum}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.contactNum}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Phone Number"/>
                                    </h:panelGroup> 

                                    <h:outputText value="Annual Revenue" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.annualRevenue}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.annualRevenue}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Annual Revenue"/>
                                    </h:panelGroup> 

                                    <h:outputText value="Mobile Number" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.mobileNum}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.mobileNum}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Mobile Number"/>
                                    </h:panelGroup> 

                                    <h:outputText value="Number of Employees" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.numOfEmployees}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.numOfEmployees}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Number of Employees"/>
                                    </h:panelGroup>

                                    <h:outputText value="Fax Number" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.faxNum}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.faxNum}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Fax Number"/>
                                    </h:panelGroup>

                                    <h:outputText value="Website" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.website}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.website}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Website"/>
                                    </h:panelGroup> 

                                    <h:outputText value="Title" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.title}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.title}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Title"/>
                                    </h:panelGroup> 

                                    <h:outputText value="Department" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.department}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.department}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Department"/>
                                    </h:panelGroup> 

                                    <h:outputText value="Email Address" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.emailAddress}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.emailAddress}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Email Address"/>  
                                    </h:panelGroup>  

                                    <h:outputText value="Rating" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.rating}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <h:selectOneMenu value="#{SalesLeadManagedBean.selectedViewSalesLead.rating}" rendered="#{SalesLeadManagedBean.editMode}">
                                            <f:selectItem itemLabel="0" itemValue="0"/>
                                            <f:selectItem itemLabel="1" itemValue="1"/>
                                            <f:selectItem itemLabel="2" itemValue="2"/>
                                            <f:selectItem itemLabel="3" itemValue="3"/>
                                            <f:selectItem itemLabel="4" itemValue="4"/>
                                            <f:selectItem itemLabel="5" itemValue="5"/>
                                        </h:selectOneMenu>
                                    </h:panelGroup>  

                                    <h:outputText value="Lead Source" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.leadSource}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>
                                        <h:selectOneMenu  value="#{SalesLeadManagedBean.selectedViewSalesLead.leadSource}" rendered="#{SalesLeadManagedBean.editMode}">
                                            <f:selectItem itemLabel="-None-" itemValue=""/>
                                            <f:selectItem itemLabel="Advertisement" itemValue="Advertisement"/>
                                            <f:selectItem itemLabel="Employes Referral" itemValue="Employes Referral"/>
                                            <f:selectItem itemLabel="External Referral" itemValue="External Referral"/>
                                            <f:selectItem itemLabel="Partner" itemValue="Partner"/>
                                            <f:selectItem itemLabel="Public Relations" itemValue="Public Relations"/>
                                            <f:selectItem itemLabel="Seminar - Internal" itemValue="Seminar - Internal"/>
                                            <f:selectItem itemLabel="Seminar - Partner" itemValue="Seminar - Partner"/>
                                            <f:selectItem itemLabel="Trade Show" itemValue="Trade Show"/>
                                            <f:selectItem itemLabel="Web" itemValue="Web"/>
                                            <f:selectItem itemLabel="Word of Mouth" itemValue="Word of Mouth"/>
                                            <f:selectItem itemLabel="Other" itemValue="Other"/>                                           
                                        </h:selectOneMenu>
                                    </h:panelGroup>

                                    <h:outputText value="Status" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.status}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>
                                        <h:selectOneMenu  value="#{SalesLeadManagedBean.selectedViewSalesLead.status}" rendered="#{SalesLeadManagedBean.editMode}">
                                            <f:selectItem itemLabel="Open" itemValue="Open"/>
                                            <f:selectItem itemLabel="Contacted" itemValue="Contacted"/>
                                            <f:selectItem itemLabel="Qualified" itemValue="Qualified"/>
                                            <f:selectItem itemLabel="Unqualified" itemValue="Unqualified"/>                                            
                                        </h:selectOneMenu>
                                    </h:panelGroup>

                                    <h:outputText value="Address" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.address}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}" />  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.address}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Address"/>
                                    </h:panelGroup>

                                    <h:outputText value="State" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.addressState}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.addressState}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="State"/>  
                                    </h:panelGroup>  

                                    <h:outputText value="Country" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.country}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.country}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Country"/>  
                                    </h:panelGroup>  

                                    <h:outputText value="City" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.city}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.city}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="City"/>  
                                    </h:panelGroup>    


                                    <h:outputText value="Postal Code" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.postalCode}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.postalCode}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Postal Code"/>  
                                    </h:panelGroup>  

                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>

                                    <h:outputText value="Description" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{SalesLeadManagedBean.selectedViewSalesLead.description}" style="font-weight:bold" rendered="#{!SalesLeadManagedBean.editMode}"/>  
                                        <p:inputText value="#{SalesLeadManagedBean.selectedViewSalesLead.description}" rendered="#{SalesLeadManagedBean.editMode}" required="true" label="Description"/>  
                                    </h:panelGroup>  

                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>

                                    <h:outputText value=""/>
                                    <h:outputText value=""/>

                                    <p:outputPanel rendered="#{SalesLeadManagedBean.editMode}" layout="block" style="text-align:right">  
                                        <p:commandButton value="Save" update="panel" actionListener="#{SalesLeadManagedBean.save}"   
                                                         oncomplete="editDialog.hide()" image="ui-icon ui-icon-check" />  
                                        <p:commandButton value="Cancel" onclick="editDialog.hide()" type="button" image="ui-icon ui-icon-close"/>  
                                    </p:outputPanel>  


                                </h:panelGrid>  
                            </center>
                        </p:dialog>  


                        <!--DIALOG FOR DELETING MULTIPLE ROW OF CUSTOMER-->
                        <p:dialog header="Delete Selected Records" modal="true" widgetVar="deleteDialog">

                            <h:outputText value="You are about to permanently delete records." /><br /><br />
                            <h:outputText value="Are you sure you want to continue?" /><br /><br/>

                            <center>
                                <p:commandButton value="Yes" ajax="true" immediate="true" update="panel" 
                                                 oncomplete="deleteDialog.hide()" actionListener="#{SalesLeadManagedBean.deleteSalesLeads}" />
                                <p:commandButton value="No" oncomplete="deleteDialog.hide()" action="#{SalesLeadManagedBean.cancelDelete()}" /> 

                            </center>
                        </p:dialog>

                        <!--DIALOG FOR CONVERTING SALES LEAD TO CUSTOMER-->
                        <p:dialog header="Convert Sales Lead" widgetVar="convertToCustomer" resizable="true"  
                                  modal="true" width="800" showEffect="blind" hideEffect="blind">  

                            <h:panelGrid id="display2" columns="3" cellpadding="4" style="font-family:Tahoma; font-size:12px">  

                                <h:outputText value="Sales lead status must be qualified before it can be converted to customer." />   
                                <h:outputText value=""/>
                                <h:outputText value=""/>


                                <p:outputPanel layout="block" style="text-align:right">  
                                    <p:commandButton value="Convert to Customer" update="growl panel" actionListener="#{SalesLeadManagedBean.convertSalesLead}"   
                                                     oncomplete="convertToCustomer.hide()" image="ui-icon ui-icon-check" />  
                                    <p:commandButton value="Cancel" onclick="convertToCustomer.hide()" type="button" image="ui-icon ui-icon-close"/>  
                                </p:outputPanel> 
                            </h:panelGrid>

                        </p:dialog>


                    </div>

                    <div id="bottom" class="bottom">
                        <h:graphicImage value="/image/merlionfooter.jpg"/>
                    </div>
                </h:form>
            </h:body>
        </f:view>
    </f:view>
</html>